//part1:C03:ex3.41.cpp -- initial a vector.
#include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>

int main(void)
{
    using namespace std;
    const int sz = 10;
    int a[sz];
    srand((unsigned)time(NULL));
    cout << "array is:" << endl;
    for (auto &val : a) 
    {
        val = rand() % 100;
        cout << val << " ";
    }
    cout << endl;
    vector<int> v1(begin(a), end(a));
    cout << "vector is:\n";
    for (auto val : v1)
    {
        cout << val << " ";    
    }
    cout << endl;

    return 0;
}
